import Vue from "vue";
import Vuex from 'vuex'
import user from './modules/user'
import getters from './getters'
import createPersistedState from 'vuex-persistedstate'

Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    namespaced: true,
    user
  },
  getters,
  // 数据持久化
  plugins: [createPersistedState({
    // 里面可以存很多的数据
    paths: ['user.token']
  })]
})

export default store